home *** CD-ROM | disk | FTP | other *** search
- /* $VER: RePostEN.thor 3.1 (02.09.1994)
- *
- * Arexx script to repost messages from a BBS to conferences on another.
- *
- * Script by: Eivind Nordseth, Ultima Thule Software.
- */
-
- options results
-
- /* trace results */
-
- EVE_ENTERMSG = 0 /* Enter message */
-
- if(substr(address(),1,4) ~= "THOR") then do
- parse arg thorport
- if~(show(p, thorport)) then do
- if ~(show(p, "THOR.01")) then do
- say "No THOR port found!"
- exit
- end
- else thorport = "THOR.01"
- end
- end
- else thorport = address()
-
- if ~show('p', 'BBSREAD') then do
- address command
- "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
- "WaitForPort BBSREAD"
- end
-
- address(thorport)
-
- CURRENTMSG stem MSG
- if(rc ~= 0) then
- do
- REQUESTNOTIFY TEXT '"No current message."' BT '"_Ok"'
- exit
- end
-
- address BBSREAD GETBBSLIST stem BBSLIST
- if(rc ~= 0) then
- do
- address(thorport)
- REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
- exit
- end
-
- REQUESTLIST instem BBSLIST outstem TOBBS title '"Select BBS to repost to"'
- if(rc ~= 0) then
- do
- if(rc ~= 5) then address(thorport) REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
- exit
- end
-
- dobbs = result
-
- address BBSREAD GETCONFLIST bbsname '"'dobbs'"' stem CONFLIST
- if(rc ~= 0) then
- do
- address(thorport)
- REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
- exit
- end
-
- REQUESTLIST instem CONFLIST outstem TOCONF title '"Select Conference"'
- if(rc ~= 0) then
- do
- if(rc ~= 5) then address(thorport) REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
- exit
- end
- doconf = result
-
- address BBSREAD
-
- UNIQUEMSGFILE bbsname '"'dobbs'"' stem UNIQUEFILE
- if(rc ~= 0) then
- do
- address(thorport)
- REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
- exit
- end
-
- READBRMESSAGE bbsname '"'MSG.BBSNAME'"' confname '"'MSG.CONFNAME'"' msgnr MSG.MSGNR headstem HEADTAGS textstem TEXTTAGS
- if(rc ~= 0) then
- do
- address(thorport)
- REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
- exit
- end
-
- if(~open('fh',UNIQUEFILE.NAME,'Append')) then
- do
- address(thorport)
- REQUESTNOTIFY TEXT '"Unable to open file:' UNIQUEFILE.NAME '"' BT '"_Ok"'
- exit
- end
-
- msgfrom = HEADTAGS.FROMNAME
- if symbol("HEADTAGS.FROMADDR") = "VAR" then msgfrom = msgfrom || ' <' || HEADTAGS.FROMADDR || '>'
-
- call writeln('fh', 'Message crossposted from: ' || MSG.BBSNAME || ':' || MSG.CONFNAME)
- call writeln('fh', 'Originally written by: ' || msgfrom)
- call writeln('fh', 'Subject: ' || HEADTAGS.SUBJECT || '0a'x)
-
- do n=1 to TEXTTAGS.TEXT.COUNT
- call writeln('fh', TEXTTAGS.TEXT.n)
- end
-
- call close('fh')
-
-
- drop EVENT.
-
- EVENT.SUBJECT = HEADTAGS.SUBJECT
- EVENT.TONAME = 'ALL'
- EVENT.CONFERENCE = doconf
- EVENT.MSGFILE = UNIQUEFILE.FILEPART
-
- WRITEBREVENT bbsname '"'dobbs'"' event EVE_ENTERMSG stem EVENT
- if(rc ~= 0) then
- do
- address(thorport)
- REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
- exit
- end
-
-